<template>
  <hc-button plain @click="outerVisible = true">
    Open the outer Dialog
  </hc-button>

  <hc-dialog v-model="outerVisible" title="Outer Dialog" width="800">
    <span>This is the outer Dialog</span>
    <hc-dialog
      v-model="innerVisible"
      width="500"
      title="Inner Dialog"
      append-to-body
    >
      <span>This is the inner Dialog</span>
    </hc-dialog>
    <template #footer>
      <div class="dialog-footer">
        <hc-button @click="outerVisible = false">Cancel</hc-button>
        <hc-button type="primary" @click="innerVisible = true">
          Open the inner Dialog
        </hc-button>
      </div>
    </template>
  </hc-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const outerVisible = ref(false)
const innerVisible = ref(false)
</script>
